<template>
  <div>
    <el-button size="mini" type="success" @click="to">编辑</el-button>
    <eForm ref="form" :roles="roles" :menus="menus" :sup_this="sup_this" :is-add="false"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    },
    menus: {
      type: Array,
      required: true
    },
    roles: {
      type: Array,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form,
        propsData = this.data
      _this.form = { 
        resourceName: propsData.resourceName,
        ifVisible: propsData.ifVisible,
        memo: propsData.memo,
        presourceNo: propsData.presourceNo,
        reqUrl: propsData.reqUrl,
        resourceNo: propsData.resourceNo,
        resourceType: propsData.resourceType,
        routePath: propsData.routePath,
        sortOrder: propsData.sortOrder,
        resourceIcon: propsData.resourceIcon,
        resourceLevel: propsData.resourceLevel,
        id: propsData.id,
        userNo: ""
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
